Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@bkchr
Copy link
Member

@bkchr bkchr commented Aug 12, 2021

I think this says all :P

polkadot companion: paritytech/polkadot#3633

I think this says all :P
@bkchr bkchr added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Aug 12, 2021
@athei
Copy link
Member

athei commented Aug 12, 2021

Should we revert this then: #9518 ?

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only question is about changes from bounded to unbounded channels in a couple of places.

#[wasm_bindgen(js_name = "rpcSend")]
pub fn rpc_send(&mut self, rpc: &str) -> js_sys::Promise {
let rpc_session = RpcSession::new(mpsc01::channel(1).0);
let rpc_session = RpcSession::new(mpsc::unbounded().0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason why this and below was changed to unbounded?

impl Metadata {
/// Create new `Metadata` with session (Pub/Sub) support.
pub fn new(transport: mpsc::Sender<String>) -> Self {
pub fn new(transport: mpsc::UnboundedSender<String>) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change to unbounded?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from jsonrpc 🤷 I only having adapted to the requirements :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was unbounded before too, it's just the name that is more explicit now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change causes the related BEEFY Update jsonrpc PR to fail.

We run into the old chicken-and-egg problem. For the BEEFY PR to compile it needs an updated version of sc_rpc::Metadata

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is failling because it is using master of Substrate that does not yet have this pr.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just approve the pr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is failling because it is using master of Substrate that does not yet have this pr.

Yep, that is what I wrote ...

let mut runtime = tokio::runtime::current_thread::Runtime::new().unwrap();
runtime.block_on(rx).unwrap()
}
#[cfg(test)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole file is already only compiled when config is test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fuck xD I'm an idiot xD

false => None,
}

version_differs.then(|| new_version.clone())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

Comment on lines 191 to 194
warn!("Failed to submit extrinsic: {}", err);
// reject the subscriber (ignore errors - we don't care if subscriber is no longer there).
let _ = subscriber.reject(err.into());
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit shittier as we're duplicating the same error handling as below.

@bkchr bkchr requested a review from kianenigma as a code owner August 12, 2021 13:46
@bkchr bkchr added the D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit label Aug 12, 2021
@bkchr
Copy link
Member Author

bkchr commented Aug 12, 2021

Should we revert this then: #9518 ?

Good question

@athei
Copy link
Member

athei commented Aug 12, 2021

Should we revert this then: #9518 ?

Good question

I think at least we should change the version there (in this PR) to >= 19 so that we get minor version bumps via the bot.

impl Metadata {
/// Create new `Metadata` with session (Pub/Sub) support.
pub fn new(transport: mpsc::Sender<String>) -> Self {
pub fn new(transport: mpsc::UnboundedSender<String>) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was unbounded before too, it's just the name that is more explicit now.

@bkchr bkchr requested a review from a team as a code owner August 12, 2021 21:11
@bkchr
Copy link
Member Author

bkchr commented Aug 12, 2021

Should we revert this then: #9518 ?

Good question

I think at least we should change the version there (in this PR) to >= 19 so that we get minor version bumps via the bot.

I have reverted it

@bkchr
Copy link
Member Author

bkchr commented Aug 13, 2021

bot merge

@ghost
Copy link

ghost commented Aug 13, 2021

Trying merge.

@ghost ghost merged commit 7342a2f into master Aug 13, 2021
@ghost ghost deleted the bkchr-upgrade-jsonrpc branch August 13, 2021 06:46
JoshOrndorff added a commit to moonbeam-foundation/frontier that referenced this pull request Aug 24, 2021
chevdor pushed a commit that referenced this pull request Sep 7, 2021
* Upgrade jsonrpc to 0.18.0

I think this says all :P

* 🤦

* Fmt etc

* Fix tests

* Fix tests again...

* Better impl

* Revert "Tell dependabot to ignore jsonrpc-* updates (#9518)"

This reverts commit f2b3997.
JoshOrndorff added a commit to moonbeam-foundation/frontier that referenced this pull request Sep 16, 2021
JoshOrndorff added a commit to moonbeam-foundation/frontier that referenced this pull request Sep 28, 2021
JoshOrndorff added a commit to moonbeam-foundation/frontier that referenced this pull request Sep 28, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants